package com.sen.patterns.creational.factory.ex1;

/**
 * 简单工厂
 * @author sen
 */
public class Factory {
	
	public static Sample creator(String str) {
		
		if ("my".equalsIgnoreCase(str)) {
			return new MySample();
		} else if ("his".equalsIgnoreCase(str)) {
			return new HisSample();
		} 
		
		return null;
	}
	
}
